#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'kang'


#循环 重复执行某个操作

#-----while-----
#计算0-100的和
i = 0
sum = 0

while i < 100:
    sum += i
    i += 1
print(sum)

#------ for...in ------

names = ['tom', 'huang', 'kang', 'zhang', 'wang']
for name in names:
    print(name, end='\n')

sum = 0
for i in range(1,100):
    print(i, end=" ,")
    sum += i

print('\n', sum)